{% load blog_tags %}

{# Preview area #}
<div id="commentReview" class="commentReview">
{% if saved_comment %}
  {% if saved_comment.is_published %}
    <h2>Comment Added</h2>
  {% else %}
    <h2>Comment Held</h2>
    <p class="note">As this is an older entry, your comment will be reviewed
    by a human before it shows permanently on this page. Please be patient, 
    as this process may take several days.</p>
  {% endif %}

  {% with comment = saved_comment %}
    {% include "blog/frag_comment.html" %}
  {% endwith %}

{% endif %}

{% if preview_comment %}
    <h2>Preview Comment</h2>
    {% with comment = preview_comment %}
      {% include "blog/frag_comment.html" %}
    {% endwith %}
{% endif %}
</div>

<div class="commentForm">
  <h2>Add Comment</h2>
  <form action="#commentReview" method="post">

    {% if cform.non_field_errors %}
      <p class="note">{{ cform.non_field_errors.as_text }}</p>
    {% endif %}

    <label for="author">Name:</label>
    <br />
    {{ cform.author }}
    {% if cform.author.errors %}
      <span class="error">{{ cform.author.errors.as_text }}</span>
    {% endif %}
    <br /><br />

    <label for="email">Email Address:</label> 
    <span class="formatInstructions">(Not displayed)</span>
    <br />
    {{ cform.email }}
    {% if cform.email.errors %}
      <span class="error">{{ cform.email.errors.as_text }}</span>
    {% endif %}
    <br /><br />

    <label for="url">URL:</label>
    <br />
    {{ cform.url }}
    {% if cform.url.errors %}
      <span class="error">{{ cform.url.errors.as_text }}</span>
    {% endif %}
    <br /><br />

    <label for="text">Comments:</label>
    {% if cform.text.errors %}
      <span class="error">{{ cform.text.errors.as_text }}</span>
    {% endif %}
    <br />
    <span class="formatInstructions">
    (Leave blank line between paragraphs. URLs converted to links. 
    HTML stripped. Indented source code will be formatted with &lt;pre&gt; 
    tags.)
    </span>
    <br />
    {{ cform.text }}
    <br /><br />
    <input type="submit" name="preview" value="&nbsp;Preview&nbsp;">
    <input type="submit" name="post" value="&nbsp;Post&nbsp;"><br /><br />
  </form>
</div>
{% comment %} 
vim:sts=2 sw=2 ts=2 ft=htmldjango: 
{% endcomment %}
